package myjava.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-09-09
 */
public class FileOutputStreamTest {
  public static void main(String[] args) {
    //
    try {
      FileOutputStream fos = new FileOutputStream("myFile.text");
      fos.write('H');
      fos.write(69);
      fos.write(76);
      fos.write('L');
      fos.write('O');
      fos.close();

    } catch (FileNotFoundException e) {
      System.out.println(e.getMessage());
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
}
